function main(param) {
    const _self = this;
    const license_plate_number = _self.$$("text_input_482q7c").$$getValue();
    const params = [{
        name: "license_plate_number",
        valueContent: license_plate_number
    }];

    getApiValue(params)
        .then(res => {
            console.log(res);
            _self.$$("custom_button_d5pal").data.props.operateItem.title = `今日违停 ${res.result[0].count} 次`;
        })
        .catch(error => {
            console.error("获取API值时出错:", error);
        });
}

function getApiValue(params) {
    return new Promise((resolve, reject) => {
        api.DATA_SOURCE_EXECUTE("6646a27b-c321-4975-8f70-73425c5258ef", "api", params, [], "")
            .then(res => {
                try {
                    const resValue = JSON.parse(res.result);
                    console.log(resValue);
                    resolve(resValue);
                } catch (parseError) {
                    console.error("解析API响应时出错:", parseError);
                    reject(parseError);
                }
            })
            .catch(apiError => {
                console.error("调用API时出错:", apiError);
                reject(apiError);
            });
    });
}
